<?php

defined('_IN_CMS') or die('Fuck off');

trait face
{
    // Трэит для вывода вёрстки
    // В функции передаются переменные и пр.
    // Вообще, нужно бы вывести вёрстку в отдельные файлы, хотя хз. Производительность там...
    
    public function showArticleFace($data)
    {
        echo '<article id="article" class="article_content">
                    '.$data['text'].'
                    <br><br>
                <span class="lessons_date">'.$data['tags'].'</span>
                </article>';
        if (check_session()) {
            if ($data['added'] == 1) {
                echo '<script>var trigger_0 = 1;</script>';
            } else {
                echo '<script>var trigger_0 = 0;</script>';
            }
            echo '
            <div class="gb_panel_addmsg">
                <img src="/inc/php/html/themes/0/images/user_m.png" class="index_article_icon" alt="u">
                <span class="lessons_date"><a href="/user/miha">'.$data['author_login'].'</a></span>
                <span class="lessons_date">31.02.2011</span>

                <img onclick="add_article_to_bookmarks('.$data['id'].', '.$data['who_watch_it'].', \'http://miha.ru\');" 
                src="/inc/php/html/themes/0/images/star_0.png" alt="A" id="bfav" class="index_article_icon">&nbsp;
                
                <a href="/add_article/edit/'.$data['id'].'/" title="Правка">
                <img src="/inc/php/html/themes/0/images/edit.png" alt="E" class="index_article_icon"></a>&nbsp;
                
                <a href="/delete.php?article_id='.$data['id'].'/" title="Удалить">
                <img src="/inc/php/html/themes/0/images/delete.png" alt="X" class="index_article_icon"></a>
            </div>';
        }
        include('inc/php/html/form_add_comment_to_article.php');
    }

    public function showArticleItem($data)
    {
        // Показать элемент списка статей (на главной)
        echo '
        <div class="list_item" id="list_item'.$this->data['id'].'">
            <div class="list_item_thumb_div" onclick="location.href=\'articles/'.$data['sec_title'].'/'.$data['cat_title'].'/'.$data['url_name'].'\';">
                <img src="'.$this->data['img_src'].'" alt="Avatar" class="list_item_thumb_img">
            </div>
            <div class="list_item_info_div">';
            if ($data['can_delete'] == 1) {
            echo '
                <div class="list_item_control_div">
                    <div class="list_item_cb_div">
                        <img src="/inc/php/html/themes/0/images/edit.png" class="list_item_cb_img" alt="E">
                    </div>
                    <div class="list_item_cb_div" onclick="document.getElementById(\'parent_popup\').style.display=\'block\'; 
                        document.getElementById(\'popup\').style.display=\'block\'; setPos(); 
                        document.getElementById(\'item_id\').value=\''.$data['id'].'\';
                        document.getElementById(\'msg_textarea\').focus(); 
                        document.getElementById(\'msg_textarea\').value=\'\';">
                        <img src="/inc/php/html/themes/0/images/delete.png" class="list_item_cb_img" alt="X">
                    </div>
                </div>';
            }
            echo '
                <div class="list_item_title_div"  onclick="location.href=\'articles/'.$data['sec_title'].'/'.$data['cat_title'].'/'.$data['url_name'].'\';">
                    <span class="list_item_title_span">'.$data['title'].'</span>
                </div>
                <div class="list_item_descr_div" onclick="location.href=\'articles/'.$data['sec_title'].'/'.$data['cat_title'].'/'.$data['url_name'].'\';">
                    '.$data['description'].'
                </div>
                <div class="list_item_stat_div">
                    <img src="/inc/php/html/themes/0/images/user_m.png" class="index_article_icon" alt="u">
                    <a href="/user/'.$data['author_login'].'">'.$data['author_login'].'</a>
                    <img src="/inc/php/html/themes/0/images/edit.png" class="index_article_icon" alt="d">'.$data['date'].'
                    <img src="/inc/php/html/themes/0/images/views.png" class="index_article_icon" alt="v">'.$data['views'].'
                    <img src="/inc/php/html/themes/0/images/comments.png" class="index_article_icon" alt="c">'.$data['comm_count'].'
                </div>
            </div>
        </div>';
            
    }

    public function showDialogsFace($data)
    {
        // Показать список диалогов в /mail
        echo '
            <div class="message_item" onclick="location.href=\'/mail/'.$data['s_text'].'\'">
                <div class="gb_avatar">
                    <img src="/data/users/avatars/'.$data['lf'].'.jpg" alt="'.$data['lf'].'" class="gb_img">
                </div>
                <div class="gb_message">
                    <div>
                        <a href="/mail/'.$data['s_text'].'" class="index_article_title">'.$data['s_text'].'</a>
                    </div>
                    '.$data['lm_text'].'
                </div>
            </div>';
    }
    
    public function showSectionsFace($data)
    {
        // Секции  статей
        echo '
        <div class="list_item" id="list_item'.$data['id'].'">
            <div class="list_item_thumb_div" onclick="location.href=\'/articles/'.$data['title'].'\'">
                <img src="/data/articles/_sections/'.$data['id'].'.jpg" alt="Avatar" class="list_item_thumb_img">
            </div>
            <div class="list_item_info_div">';
            if ($data['can_delete'] == 1) {
            echo '
                <div class="list_item_control_div">
                    <div class="list_item_cb_div">E</div>
                    <div class="list_item_cb_div" onclick="document.getElementById(\'parent_popup\').style.display=\'block\'; 
                        document.getElementById(\'popup\').style.display=\'block\'; setPos(); 
                        document.getElementById(\'item_id\').value=\''.$data['id'].'\';
                        document.getElementById(\'msg_textarea\').focus(); 
                        document.getElementById(\'msg_textarea\').value=\'\';">X</div>
                </div>';
            }
            echo '
                <div class="list_item_title_div"  onclick="location.href=\'/articles/'.$data['title'].'\'">
                    <span class="list_item_title_span">'.$data['full_title'].'</span>
                </div>
                <div class="list_item_descr_div" onclick="location.href=\'articles/'.$data['title'].'\';">
                    '.$data['description'].'
                </div>
                <div class="list_item_stat_div">

                </div>
            </div>
        </div>';
    }
    
    public function showSectionsForumFace($data)
    {
        // Вывод секций форума
        echo '
        <div class="list_item" id="list_item'.$data['id'].'">
            <div class="list_item_thumb_div" onclick="location.href=\'/forum/'.$data['title'].'\'">
                <img src="/'.$this->data['img_path'].'" alt="Avatar" class="list_item_thumb_img">
            </div>
            <div class="list_item_info_div">';
            if ($data['can_delete'] == 1) {
            echo '
                <div class="list_item_control_div">
                    <div class="list_item_cb_div">E</div>
                    <div class="list_item_cb_div" onclick="document.getElementById(\'parent_popup\').style.display=\'block\'; 
                        document.getElementById(\'popup\').style.display=\'block\'; setPos(); 
                        document.getElementById(\'item_id\').value=\''.$data['id'].'\';
                        document.getElementById(\'msg_textarea\').focus(); 
                        document.getElementById(\'msg_textarea\').value=\'\';">X</div>
                </div>';
            }
            echo '
                <div class="list_item_title_div"  onclick="location.href=\'/forum/'.$data['title'].'\'">
                    <span class="list_item_title_span">'.$data['full_title'].'</span>
                </div>
                <div class="list_item_descr_div" onclick="location.href=\'forum/'.$data['title'].'\';">
                    '.$data['description'].'
                </div>
                <div class="list_item_stat_div">
                    Тем: <span>'.$this->data['count'].'</span>
                </div>
            </div>
        </div>';
    }
    
    public function showMessagesFaceGb($data)
    {
        // Показать записи в гостевой книге
        echo '
        <div class="message_item">
            <div class="gb_avatar">
                <img src="/data/users/avatars/'.$data['id'].'.jpg" class="gb_img">
            </div>
            <div class="gb_message">
                <a href="user/'.$data['author'].'">'.$data['author'].'</a>
                <span class="lessons_date">('.$data['date'].')</span><br>
                '.$data['text'].'
            </div>
        </div>';
    }
    
    public function showDialogFace($data)
    {
        if ($data['new'] == 1) {
            $new_class = ' msg_new';
        } else {
            $new_class = '';
        }
        echo '
        <div class="message_item">
            <div class="gb_avatar">
                <img src="/data/users/avatars/'.$data['author'].'.jpg" alt="'.$data['author'].'" class="gb_img">
            </div>
            <div class="gb_message'.$new_class.'">
                <a href="user/'.$data['login'].'">'.$data['login'].'</a>
                <span class="lessons_date">('.$data['date'].')</span><br>
                '.$data['text'].'
            </div>
        </div>';
    }

    public function showCategoriesFace($data)
    {
        echo '
        <div class="cat_item" onclick="location.href=\'/articles/'.$data['section'].'/'.$data['cat_title'].'/'.'\'">
            <div class="article_thumb_div"><!-- Эскиз -->
                <img src="/data/articles/_categories/'.$data['cat_id'].'.jpg" alt="Avatar" class="index_article_thumb">
            </div>
            <div><!-- Заголовок -->
                <a href="/articles/'.$data['section'].'/'.$data['cat_title'].'/'.'" class="index_article_title">'.$data['full_title'].'</a>
            </div>
            <div class="articles_description">'.$data['description'].'</div>
            <div class="articles_panel_info_panel"><!-- Нижняя панель информации-->
                Модераторы: <img src="/inc/php/html/themes/0/images/user_m.png" class="index_article_icon" alt="u"><a href="#">'.$data['author_login'].'</a>
            </div>
        </div>';
    }

    public function showArticlesFace($data)
    {
        echo '<div class="cat_item">
            <div class="article_thumb_div"><!-- Эскиз -->
                <img src="/data/articles/'.$data['id'].'/thumb.jpg" alt="Avatar" class="index_article_thumb">
            </div>
            <div><!-- Заголовок -->
                <a href="/articles/'.$data['section_title'].'/'.$data['cat_title'].'/'.$data['url_name'].'" class="index_article_title">'.$data['title'].'</a>
            </div>
            <div class="articles_description">'.$data['description'].'</div>
            <div class="articles_panel_info_panel"><!-- Нижняя панель информации-->
                <img src="/inc/php/html/themes/0/images/user_m.png" class="index_article_icon" alt="u"><a href="/user/'.$data['author_login'].'" class="articles_panel_info_panels">'.$data['author_login'].'</a>
                <img src="/inc/php/html/themes/0/images/icons/views.png" class="index_article_icon" alt="c"><span class="articles_panel_info_panels">'.$data['author_login'].'</span>
                <img src="/inc/php/html/themes/0/images/comments.png" class="index_article_icon" alt="c"><span class="articles_panel_info_panels">64</span>
            </div>
        </div>';
    }
    
    public function showShortFace($data)
    {
        echo '
        <div class="index_article_item">
            <div class="article_thumb_div"><!-- Эскиз -->
                <img src="data/articles/'.$data['id'].'/thumb.jpg" alt="Avatar" class="index_article_thumb">
            </div>
            <div><!-- Заголовок -->
                <a href="articles/'.$data['section_title'].'/'.$data['cat_title'].'/'.$data['url_name'].'" class="index_article_title">'.$data['title'].'</a>
            </div>
            <div class="articleы_description">'.$data['description'].'</div>
            <div class="articles_panel_info_panel"><!-- Нижняя панель информации-->
                <img src="/inc/php/html/themes/0/images/user_m.png" class="index_article_icon" alt="u"><a href="/user/'.$data['author_login'].'">'.$data['author_login'].'</a>
                <img src="image.jpg" class="index_article_icon" alt="d"><span>'.$data['date'].'</span>
                <img src="image.jpg" class="index_article_icon" alt="m"><span>64</span>
            </div>
        </div>';
    }
    
    public function showTopicMessagesFace($data)
    {
        echo '
        <div class="message_item">
            <div class="gb_avatar">
                <img src="/data/users/avatars/'.$data['author_id'].'.jpg" class="gb_img"><br>
            </div>
            <div class="gb_message">
                <div style="color: #666; background-color: #ddd; width: 100%; border-radius: 4px 4px 0px 0px; line-height: 18px; font-size: 16px;">
                    <a href="/user/'.$data['user_login'].'" style="color: #666;">'.$data['user_login'].'</a>
                    <span class="lessons_date">('.$data['date'].')</span>
                </div>
                <div class="message_text">
                    '.$data['text'].'
                </div>
            </div>
        </div>';
    }
    
    public function showTopMessage($data)
    {
        echo '
            <div class="message_item" style="background: #ADF;">
                '.$data['top_message'].'
            </div>
        ';
    }

    public function showForumAddMessage($data)
    {
        // Показать форму отправки сообщения в топик
        echo '
        <div class="clear"></div>
            
        <form action="/forum/'.$data['section_title'].'/'.$data['category_title'].'/'.$data['topic_title'].'" method="post">
            <div>
                <div class="panel_addmsg">
                        <div class="auth_col2">
                        <div class="auth_col2">';
        include('inc/php/html/tags_bb.php');
        echo '</div>
        <textarea class="input_text" name="article" id="articlei" cols="13" required></textarea>';
        require('inc/php/js/resize_textarea.js');
        echo '</div>
                    <div>
                        <input type="submit" class="button_login gb_button_add" name="addMessage" value="Отправить">
                    </div>
                </div>
            </div>
        </form>
        
        ';
    }
    
    public function showForumTopPanel(&$section_id, &$category_id, &$section_title, &$category_title)
    {
        echo '
            <div class="gb_panel_addmsg">
                <a class="spoiler" href="#spoiler">
                    <div class="button_filter">Новая тема</div>
                    <div class="spoiler-content">
                        <form method="post" action="/forum/'.$section_title.'/'.$category_title.'">
                            <input type="hidden" name="section" value="'.$section_id.'">
                            <input type="hidden" name="category" value="'.$category_id.'">
                            <input type="text" name="title" value="" placeholder="Название темы"><br>
                            <input type="submit" name="create_topic" value="Новая тема" class="button_filter">
                        </form>
                        <input type="submit" name="cancel" value="Отмена" class="button_filter">
                    </div>
                </a>
            </div>        
        ';
    }
    
    public function showGalleryItem($data)
    {
        echo '
        <div class="gallery_work_shell" onClick="location.href=\'/gallery/show/'.$data['img_id'].'\'">
            <img src="/'.$data['thumbs_place'].$data['img_name'].'" alt="'.$data['title'].'" class="gallery_thumb_img">
            <div class="gallery_thumb_title">'.$data['title'].'</div>
        </div>
        ';
    }
    
    public function showTopicsFace($data)
    {
        // Показать список тем
        echo '
        <div class="list_item topic_item">
            <div class="topic_item_thumb_div">
                <img src="/inc/php/html/themes/0/images/topic.png" alt="T" class="topic_item_thumb_img">
            </div>
            <div class="list_item_info_div">';
            if (1 == 1) {
            echo '
                <div class="list_item_control_div">
                    <div class="list_item_cb_div">E</div>
                    <div class="list_item_cb_div" onclick="document.getElementById(\'parent_popup\').style.display=\'block\'; 
                        document.getElementById(\'popup\').style.display=\'block\'; setPos(); 
                        document.getElementById(\'item_id\').value=\''.$data['id'].'\';
                        document.getElementById(\'msg_textarea\').focus(); 
                        document.getElementById(\'msg_textarea\').value=\'\';">X</div>
                </div>';
            }
            echo '
            <div>
                <a href="/forum/'.$data['section_title'].'/'.$data['cat_title'].'/'.$data['title'].'" class="index_article_title">'.$data['full_title'].'</a>
            </div>

                <div class="list_item_stat_div">
                [<img src="/inc/php/html/themes/0/images/user_m.png" class="index_article_icon" alt="a">
                <a href="/user/'.$data['author_login'].'">'.$data['author_login'].'</a> / 
                <img src="/inc/php/html/themes/0/images/user_m.png" class="index_article_icon" alt="b">
                    <a href="/user/'.$data['last_post_by'].'">'.$data['last_post_by'].'</a>]
                    <img src="/inc/php/html/themes/0/images/edit.png" class="index_article_icon" alt="d">
                    <span class="articles_panel_info_panels">'.$data['date'].'</span>
                    <img src="/inc/php/html/themes/0/images/comments.png" class="index_article_icon" alt="c">
                    <span class="articles_panel_info_panels">'.$data['mess_count'].'</span>
                </div>
        </div></div>
        ';
    }

    public function showUserProfile($userdata, $url)
    {
        echo '
        <div class="adiv0">
            <div style="float: left; display: table-cell; width: 218px; text-align: center;">
                <div class="user_profile_col">
                    <img src="/data/users/avatars/'.$userdata['id'].'.jpg" alt="'.$userdata['login'].'" style="margin: 4px; min-width: 200px; max-width: 200px;">
                </div>
                <div class="user_profile_col">
                    <div class="user_profile_votepan">
                        <div unselectable="on" class="user_profile_button_minus" onclick="vote('.$userdata['id'].', -1);">-</div>
                        <div unselectable="on" class="user_profile_value" id="rating">'.$userdata['rating'].'</div>
                        <div unselectable="on" class="user_profile_button_plus" onclick="vote('.$userdata['id'].', 1);">+</div>
                    </div>';
                    
                    if (isset($_SESSION['login'])) {
                        if (($_SESSION['login'] != $userdata['login']) && (1==1)) {
                            echo '
                            <div class="user_profile_votepan">
                                <div unselectable="on" class="user_profile_sendmsg" 
                                onclick="document.getElementById(\'parent_popup\').style.display=\'block\'; 
                                document.getElementById(\'popup\').style.display=\'block\'; setPos(); 
                                document.getElementById(\'msg_textarea\').focus(); 
                                document.getElementById(\'msg_textarea\').value=\'\';">Отправить сообщение</div>
                            </div>
                            ';
                        }
                    }
                echo '
                </div>
            </div>
            
            <div class="adiv0">
                <div class="user_profile_col" style="padding: 2px 0px;">
                    Имя: '.$userdata['name'].'<br>';
                    if (!empty($userdata['email'])) echo 'e-mail: '.$userdata['email'].'<br>';
                    if (!empty($userdata['webpage'])) echo 'Сайт: '.$userdata['webpage'].'<br>';
                    if (!empty($userdata['jabber'])) echo 'Jabber: '.$userdata['jabber'].'<br>';
                    if (!empty($userdata['skype'])) echo 'Skype: <a href="skype:'.$userdata['skype'].'">'.$userdata['skype'].'</a><br>';
                    if (!empty($userdata['skype'])) echo 'О себе: '.$userdata['about'].'<br>';
                    echo '
                    Был на сайте: '.$userdata['date_last_visit'].'<br>
                </div>

            </div>
        </div>
        <div id="parent_popup" onclick="document.getElementById(\'parent_popup\').style.display=\'none\'; document.getElementById(\'popup\').style.display=\'none\';">
        </div>
        <div id="popup" onmousedown="dragOBJ(this, event);  return false;">
            <div id="popup_header">Отправить сообщение пользователю '.$userdata['name'].'</div>
            <form action="/mail" method="POST">
                <textarea id="msg_textarea" name="text" placeholder="Текст сообщения" class="input_text" style="height: 184px; width: 410px; margin: 2px;" required></textarea><br>
                <input type="hidden" name="to" value="'.$userdata['id'].'">
                <input type="hidden" name="login" value="'.$userdata['login'].'">
                <button type="submit" name="send" class="button_login" style="margin: 0px 2px; cursor: pointer;">Отправить</button>
                <div class="button_login" style="float: right; width: 140px; height: 30px; margin: 0px 2px 0px 0px; cursor: pointer;" onClick="document.getElementById(\'parent_popup\').style.display=\'none\'; document.getElementById(\'popup\').style.display=\'none\';">Отмена</div>
            </form>
        </div>
        ';
    }
    
    public function printError($text)
    {
        if (is_array($text)) {
            echo '<div class="error_message"><ul>';
            foreach ($text as $val) {
                if (empty($val)) continue;
                echo '<li>'.$val.'</li>';
            }
            echo '</ul></div>';
        } else {
            echo '
            <div class="error_message">
                '.$text.'
            </div>
            ';
        }
    }

    public function printMessage($text)
    {
        if (is_array($text)) {
            echo '<div class="message_ok"><ul>';
            foreach ($text as $val) {
                if (empty($val)) continue;
                echo '<li>'.$val.'</li>';
            }
            echo '</ul></div>';
        } else {
            echo '
            <div class="message_ok">
                '.$text.'
            </div>
            ';
        }
    }

    public function showLastTopicsLeft($data)
    {
        echo '
            <span onclick="location.href=\'/forum/'.$data['section_title'].'/'.$data['category_title'].'/'.$data['title'].'\';" style="font-size: 14px;">
                <img src="/inc/php/html/themes/0/images/topic_m.png" alt="P" style="width: 14px; height: 14px; margin: 0px 4px;"><a href="/forum/'.$data['section_title'].'/'.$data['category_title'].'/'.$data['title'].'" title="'.$data['full_title'].'">'.$data['full_title'].'</a>
                <a href="/user/'.$data['last_post_by_login'].'">('.$data['last_post_by_login'].')</a>
            </span><br>
        ';
    }

    public function showStatisticsFace($data)
    {
        // Вывод таблицы статистики
        echo '
            <div class="gb_panel_addmsg" style="text-align: center;">
                <form action="/statistics/deleted" method="post">
                    <input type="text" name="ip_filter" class="input_text" style="width: 128px;" placeholder="IP" value="'.$this->ip_filter.'">
                    <input type="text" name="ua_filter" class="input_text" style="width: 170px;" placeholder="User-Agent" value="'.$this->ua_filter.'">
                    <input type="text" name="os_filter" class="input_text" style="width: 170px;" placeholder="OS" value="'.$this->os_filter.'">
                    <nobr>
                    <input type="submit" name="filter" value="Отфильтровать" class="button_reset" style="width: 170px;">
                    <input type="submit" name="reset" value="X" class="button_reset">
                    </nobr>
                </form>
            </div>
        <div style="padding: 4px;">
        <table class="statistics_table">
            <thead>
                <tr class="stat_tr">
                    <td class="stat_td_time">Время</td>
                    <td class="stat_td_url">URL</td>
                    <td class="stat_td_ip">IP</td>
                    <td class="stat_td_ua">UA</td>
                    <td class="stat_td_ua">User</td>
                    <td class="stat_td_ref">Referer</td>
                    <td class="stat_td_do">[E]</td>
                    <td class="stat_td_do">[X]</td>
                </tr>
            </thead>';

            for ($i = 0; $i < count($data); $i++)
            {
                echo '
                    <tr id="item'.$data[$i]['id'].'">
                    <td class="stat_td_time">'.date('H:i d.m.Y', strtotime($data[$i]['date'])).'</td>
                    <td class="stat_td_url">'.$data[$i]['req'].'</td>
                    <td class="stat_td_ip">'.$data[$i]['ip'].'</td>
                    <td class="stat_td_ua">
                        <img src="/inc/php/html/themes/0/images/ua/'.$data[$i]['ua'].'.png" alt="'.$data[$i]['ua'].'" class="ua_image_small">
                        <img src="/inc/php/html/themes/0/images/ua/'.$data[$i]['os'].'.gif" alt="'.$data[$i]['os'].'" class="ua_image_small">
                    </td>
                    <td class="stat_td_ua">
                    <a href="/user/'.$data[$i]['user_login'].'">'.$data[$i]['user_login'].'</a>
                    </td>
                    <td class="stat_td_ref">
                        <a href="'.$data[$i]['ref'].'">'.substr(parse_refer($data[$i]['ref']), 0, 64).'</a>
                    </td>
                <td>
                    <div class="list_item_cb_div">
                    <img src="/inc/php/html/themes/0/images/edit.png" class="list_item_cb_img" alt="E"></div>
                </td>
                <td>
                    <div class="list_item_cb_div" onclick="deleteStatItem('.$data[$i]['id'].'); document.getElementById(\'parent_popup\').style.display=\'block\'; 
                            document.getElementById(\'popup\').style.display=\'block\'; setPos(); 
                            document.getElementById(\'item_id\').value=\''.$data[$i]['id'].'\';
                            document.getElementById(\'msg_textarea\').focus(); 
                            document.getElementById(\'msg_textarea\').value=\'\';">
                        <img src="/inc/php/html/themes/0/images/delete.png" class="list_item_cb_img" alt="X">
                    </div>
                </td>
                    </tr>
                ';
            }
            
            echo '
            </table></div>';
    }
    
    public function showGalleryWorkFace($data)
    {
        echo '
        <div class="page_header">'.$data['title'].'</div>
        <div class="clear"></div>

        <!-- Контейнер для изображения, описания и оценок-->
        <div style="background: #ddf; min-width: 560px; height: 280px; padding: 10px;">

            <div class="gallery_botebar" id="parent">
                <div id="child">
                    <div class="gallery_votebutton gallery_votebutton5" onClick="gallery_vote('.$data['img_id'].', '.$data['mark_total'].', '.$data['mark_count'].', 5);">5</div>
                    <div class="gallery_votebutton gallery_votebutton4" onClick="gallery_vote('.$data['img_id'].', '.$data['mark_total'].', '.$data['mark_count'].', 4);">4</div>
                    <div class="gallery_votebutton gallery_votebutton3" onClick="gallery_vote('.$data['img_id'].', '.$data['mark_total'].', '.$data['mark_count'].', 3);">3</div>
                    <div class="gallery_votebutton gallery_votebutton2" onClick="gallery_vote('.$data['img_id'].', '.$data['mark_total'].', '.$data['mark_count'].', 2);">2</div>
                    <div class="gallery_votebutton gallery_votebutton1" onClick="gallery_vote('.$data['img_id'].', '.$data['mark_total'].', '.$data['mark_count'].', 1);">1</div>
                </div>
            </div>
            <div style="float" left;">
                <a href="/data/gallery/works/'.$data['img_name'].'" rel=\'iLoad|Графика\' title=\''.$data['title'].'\'>
                    <img src="/'.$data['thumbs_place'].$data['img_name_thumb'].'" style="max-width: 480px; height: 280px; border-radius: 8px;" alt="thumb">
                </a>
            </div>
        </div>

        <div style="background: #ddf; min-width: 560px; padding: 10px;">
        <pre style="text-align: left; ">'.$data['description'].'</pre>
        </div>
        ';
    }

    public function showUserlistFace($data)
    {
        // Вывод таблицы пользователей
        echo '
            <div class="gb_panel_addmsg" style="text-align: center;">
                <form action="/statistics/deleted" method="post">
                    <input type="text" name="ip_filter" class="input_text" style="width: 128px;" placeholder="IP" value="'.$this->ip_filter.'">
                    <input type="text" name="ua_filter" class="input_text" style="width: 170px;" placeholder="User-Agent" value="'.$this->ua_filter.'">
                    <input type="text" name="os_filter" class="input_text" style="width: 170px;" placeholder="OS" value="'.$this->os_filter.'">
                    <nobr>
                    <input type="submit" name="filter" value="Отфильтровать" class="button_reset" style="width: 170px;">
                    <input type="submit" name="reset" value="X" class="button_reset">
                    </nobr>
                </form>
            </div>
            <div style="padding: 4px;">
            <table class="statistics_table">
                <thead>
                    <tr class="stat_tr">
                        <td>id</td>
                        <td>login</td>
                        <td>password</td>
                        <td>name</td>
                        <td>email</td>
                        <td>date_last_visit</td>
                        <td>[E]</td>
                        <td>[X]</td>
                    </tr>
                </thead>
        ';

        for ($i = 0; $i < count($data); $i++)
        {
            echo '
                <tr id="item_'.$data[$i]['id'].'">
                <td>'.$data[$i]['id'].'</td>
                <td>'.$data[$i]['login'].'</td>
                <td>'.$data[$i]['password'].'</td>
                <td>'.$data[$i]['name'].'</td>
                <td>'.$data[$i]['email'].'</td>
                <td>'.$data[$i]['date_last_visit'].'</td>
                <td>
                    <div class="list_item_cb_div">
                    <img src="/inc/php/html/themes/0/images/edit.png" class="list_item_cb_img" alt="E"></div>
                </td>
                <td>
                    <div class="list_item_cb_div" onclick="deleteUser('.$data[$i]['id'].'); document.getElementById(\'parent_popup\').style.display=\'block\'; 
                            document.getElementById(\'popup\').style.display=\'block\'; setPos(); 
                            document.getElementById(\'item_id\').value=\''.$data[$i]['id'].'\';
                            document.getElementById(\'msg_textarea\').focus(); 
                            document.getElementById(\'msg_textarea\').value=\'\'; ">
                        <img src="/inc/php/html/themes/0/images/delete.png" class="list_item_cb_img" alt="X">
                    </div>
                </td>
                </tr>
            ';
        }
            
        echo '
        </table></div>';
    }
}

?>
